package com.feri.openapi.controller;

import com.feri.openapi.dto.UserDto;
import com.feri.openapi.service.UserService;
import com.feri.openapi.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping("provider/user/save.do")
    public R save(@RequestBody UserDto userDto){

        return userService.save(userDto);
    }

    //校验手机号
    @GetMapping("provider/user/checkPhone.do")
    public R checkPhone(@RequestParam String phone){
        return userService.checkPhone(phone);
    }

    //校验昵称
    @GetMapping("provider/user/checkName.do")
    public R checkName(String name){
        return userService.checkName(name);
    }


}
